package world.criver.h50529.function;

import world.criver.h50529.data.daData;
import world.criver.h50529.module.moEvent;
import world.criver.h50529.module.moGroup;

import java.util.ArrayList;

public class funData {
    public moGroup getGroup(String name){
        for(moGroup g: daData.groups)if(g.getName().equals(name))return g;
        return null;
    }
    public ArrayList<moGroup> getGroups(int port){
        ArrayList<moGroup> groups = new ArrayList<>();
        for(moGroup g: daData.groups)
            if(g.getPort() == port)groups.add(g);
        return groups;
    }
    public moEvent getEvent(String name){
        for(moEvent e: daData.events)if(e.getName().equals(name))return e;
        return null;
    }
}
